#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
    int E, G, A, L;
    for (E = 0; E <= 9; E++)
    {
        for (G = 0; G <= 9; G++)
        {
            for (A = 0; A <= 9; A++)
            {
                for (L = 0; L <= 9; L++)
                {
                    if ((E * 1000 + G * 100 + A * 10 + L) * L == (L * 1000 + A * 100 + G * 10 + E) && E != G && E != A && E != L && G != A && G != L && A != L)
                    {
                        printf("E=% d G=% d A=%d L=%d", E, G, A, L);
                        break;
                    }
                 }
            }
        }
    }
    return 0;
}